     <?php use frontend\models\Order; ?>     
     <?php foreach ($data as $order) :?>
    <div class="row salemain">
         <p class="salename">
            <span <?php if ($order->rise_fall == Order::RISE): ?>class="bg_z"<?php endif ?>><?= $order->riseFallValue ?></span><?= $order->product->name ?>
         </p>
      <ul class="sale_ul">
          <li>
              <span><?= $order->price ?></span>购买价格
          </li>
          <li>
              <span><?= $order->sell_price ?></span>到期价格
          </li>
          <li>
              <span><?= $order->deposit ?></span>购买金额
          </li>
          <li>
              <?php 
              if ($order->profit >= 0) {
                $style = 'color: red';
                $profit = $order->profit + $order->deposit;
              } else {
                $style = 'color: green';
                $profit = floatval($order->profit);
              } ?>
              <span style="<?= $style ?>"><?= $profit ?></span>盈亏       
          </li>
       </ul> 
       <p class="sale_time">
              <span class="fl">下单时间：<?= $order->created_at ?></span><span class="fr">平仓时间：<?= $order->updated_at ?></span>
       </p>  
    </div> 
     <?php endforeach ?>  